/*
	File:		IObjectManager.h
	Author:		dmonroe
	Date:		11/27/2012
	Copyright:	Full Sail University

	Purpose:	Create, store, and maintain game objects
*/

#ifndef IOBJECTMANAGER_H
#define IOBJECTMANAGER_H


// Forward class declaration
class IEntity;



class IObjectManager
{
public:
	// SINGLETON
	static IObjectManager*		GetInstance		( void );
	static void					DeleteInstance	( void );
	
	// SETUP
	virtual bool		Initialize			( void )	= 0;
	virtual bool		Terminate			( void )	= 0;
	
	// OBJECT FACTORY
	virtual bool		RegisterObject		( unsigned int ID, IEntity* (*pFunction)( void* ) )			= 0;
	virtual void		UnregisterObject	( unsigned int ID )											= 0;
	virtual IEntity*	CreateObject		( unsigned int ID, void* pData )							= 0;
	virtual IEntity*	CreateAndStoreObject( unsigned int ID, void* pData, unsigned int unCategory )	= 0;

	// OBJECT STORAGE
	virtual void		StoreObject			( IEntity* pObject, unsigned int unCategory )	= 0;
	virtual void		RemoveObject		( IEntity* pObject, unsigned int unCategory )	= 0;
	virtual void		RemoveObjects		( unsigned int unCategory )						= 0;
	virtual void		RemoveAllObjects	( void )										= 0;

	// OBJECT INTERACTION
	virtual void		InputAllObjects		( float fElapsedTime )	= 0;
	virtual void		UpdateAllObjects	( float fElapsedTime )	= 0;
	virtual void		RenderAllObjects	( float fElapsedTime )	= 0;
	virtual void		ForEachObject		( void (IEntity::*pMethod)( void ) )	= 0;
	virtual void		CheckCollisions		( unsigned int unCategory1, unsigned int unCategory2, bool bMutualResponse = true )	= 0;
	virtual void		CheckAllCollisions	( void )				= 0;
	
protected:
	IObjectManager			( void )			// Default constructor
		{	/* do nothing*/		}
	virtual ~IObjectManager	( void )			// Destructor
		{	/* do nothing*/		}

private:
	IObjectManager			 ( const IObjectManager& OM );	// Copy constructor
	IObjectManager& operator=( const IObjectManager& OM );	// Assignment operator
};

#endif //IOBJECTMANAGER_H
